<template>
  <li class="list-item alink" @click="handleClick">
    <el-image class="left" :src="icon" fit="contain" lazy>
      <el-image class="left" slot="error" :src="defaultIcon" fit="contain">
      </el-image>
    </el-image>
    <div class="main">
      <h6 class="main-title">{{ title }}</h6>
      <ul class="sub-line">
        <li class="text-t999">
          <i class="el-icon-location"></i> {{ address }}
        </li>
      </ul>
    </div>
    <!-- <div class="right">
        <div>{{ parseTime(buildTime, "{y}-{m}-{d}") }}</div>
        <div>成立时间</div>
      </div> -->
  </li>

  <!-- <router-link
    class="block"
    target="_blank"
    :to="{
      path: '/info/infodetail/' + itemId,
    }"
  >
  </router-link> -->
</template>



<script>


// attributesId: (...)
// city: (...)
// cityId: (...)
// content: (...)
// createBy: (...)
// createTime: (...)
// createUserId: (...)
// detailedAddress: (...)
// draft: (...)
// id: (...)
// isDelete: (...)
// isRecommend: (...)
// location: (...)
// params: (...)
// phone: (...)
// picture: (...)
// province: (...)
// provinceId: (...)
// publishTime: (...)
// region: (...)
// remark: (...)
// schoolId: (...)
// searchValue: (...)
// sort: (...)
// status: (...)
// studyFieldId: (...)
// synopsis: (...)
// title: (...)
// updateBy: (...)
// updateTime: (...)
// updateUserId: (...)

export default {
  props: {
    itemId: {
      type: Number,
      default: -1,
    },
    icon: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "暂无名称",
    },

    address: {
      type: String,
      default: "暂无",
    },


    comDisabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      defaultIcon: require("@/assets/images/company/default.png"),
    };
  },
  methods: {
    // handleClick() {
    //   if (this.itemId !== -1) {
    //     this.$emit("itemClick", this.itemId);
    //   }
    // },
    handleClick() {
      if (this.itemId !== -1 && !this.comDisabled) {
        this.$router.push({
          path: "/info/schooldetail/" + this.itemId,
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.list-item {
  @apply flex p-4 border-b-2  border-gray-100 cursor-pointer;
  .left {
    min-width: 103px;
    min-height: 103px;
    width: 103px;
    height: 103px;
    @apply rounded-md shadow-lg;
  }
  .main {
    @apply flex-1 flex-grow flex flex-col justify-around px-4;
    .main-title {
      @apply text-left;
    }
    .sub-line {
      @apply flex text-sm;
      li {
        @apply mr-6;
      }
    }
  }
  .right {
    @apply m-auto text-t999;
  }
}
</style>